package com.example.common.exception;

import com.example.common.resp.ResultInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ZhengDing
 * @date 2022/2/20 22:28
 */

@Data
@NoArgsConstructor
public class ApiException extends RuntimeException{
    static final long serialVersionUID = -7034897190745766932L;
    
    private Integer code;
    private String msg;
    
    public ApiException(ResultInfo resultInfo) {
        this.code = resultInfo.getCode();
        this.msg = resultInfo.getMsg();
    }
}
